#pragma once
#include <QComboBox>

class QComboBoxManager {
public:
    static QComboBoxManager& getInstance() {
        static QComboBoxManager instance;
        return instance;
    }

    // 获取typeComboBox实例
    QComboBox* getTypeComboBox() const {
        return typeComboBox;
    }

    // 获取satComboBox实例
    QComboBox* getSatComboBox() const {
        return satComboBox;
    }

    // 设置typeComboBox实例
    void setTypeComboBox(QComboBox* comboBox) {
        typeComboBox = comboBox;
    }

    // 设置satComboBox实例
    void setSatComboBox(QComboBox* comboBox) {
        satComboBox = comboBox;
    }

    QString getType() const {
        return typeComboBox->currentText();
    }

    int getSat() const {
        return satComboBox->currentIndex();
    }

private:
    QComboBoxManager() : typeComboBox(nullptr), satComboBox(nullptr) {}
    ~QComboBoxManager() {}

    QComboBox* typeComboBox;
    QComboBox* satComboBox;

    // 删除拷贝构造函数和赋值操作符以防止复制
    QComboBoxManager(const QComboBoxManager&) = delete;
    QComboBoxManager& operator=(const QComboBoxManager&) = delete;
};

// 调用示例
//#include "widgets/bottomWidgetContent/QComboBoxManager.h" // 包含头文件

// QComboBox* typeComboBox = QComboBoxManager::getInstance().getTypeComboBox();
// QComboBox* satComboBox = QComboBoxManager::getInstance().getSatComboBox();